package br.uefs.cedoc.controle.teste;

import br.uefs.cedoc.controle.*;
import br.uefs.cedoc.db.exception.DBConnectionException;
import br.uefs.cedoc.db.serie.DBSerie;
import javax.servlet.*;
import javax.servlet.http.*;
import br.uefs.cedoc.entidades.*;
import java.sql.SQLException;

public class GetAllCommand implements Command {
  private String next;


  public GetAllCommand(String next) {
    this.next = next;
  }

    public String execute(HttpServletRequest req)
    throws CommandException {

        try {
            
            DBSerie DBSerie = new DBSerie();
            SerieBean[] series = DBSerie.listarSeries();
            req.setAttribute("serie",series);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } catch (DBConnectionException ex) {
                ex.printStackTrace();
            }  
            return next;
     
        } 
    }





